# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=fflas-ffpack
pkgver=2.5.0
pkgrel=1
pkgdesc='A library for dense linear algebra over word-size finite fields'
arch=(loong64 x86_64) # pkgconfig file is arch-specific
url='https://linbox-team.github.io/fflas-ffpack/'
license=(LGPL)
depends=(givaro cblas lapack)
source=(https://github.com/linbox-team/fflas-ffpack/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --enable-precompilation --with-blas-libs="-lblas -lcblas -llapack"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

check() {
  cd $pkgname-$pkgver
  make check || true # tests are flaky
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
